package com.song.cloud.seata.controller;

import com.song.cloud.common.entities.CommonResult;
import com.song.cloud.seata.dao.StorageDao;
import org.checkerframework.checker.units.qual.C;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author ZhangGuisong
 * @Date 2021/3/4-22:52
 */
@RestController
public class storageController {
    @Autowired
    private StorageDao storageDao;
    @PostMapping("/storage/decreateStorage")
    public CommonResult decreateStorage(@RequestParam("productId") Long productId, @RequestParam("count") Integer count){
        storageDao.decreateStorage(productId,count);
        return new CommonResult(200,"库存修改"+count,"good");
    }

}
